package com.huaju.enity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * SubMenu entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sub_menu", catalog = "licai")
public class SubMenu implements java.io.Serializable {

	// Fields

	private Integer subMenuId;
	private Menu menu;
	private String name;
	private String action;

	// Constructors

	/** default constructor */
	public SubMenu() {
	}

	/** full constructor */
	public SubMenu(Menu menu, String name, String action) {
		this.menu = menu;
		this.name = name;
		this.action = action;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "sub_menu_id", unique = true, nullable = false)
	public Integer getSubMenuId() {
		return this.subMenuId;
	}

	public void setSubMenuId(Integer subMenuId) {
		this.subMenuId = subMenuId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "menu_id")
	public Menu getMenu() {
		return this.menu;
	}

	public void setMenu(Menu menu) {
		this.menu = menu;
	}

	@Column(name = "name", length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "action")
	public String getAction() {
		return this.action;
	}

	public void setAction(String action) {
		this.action = action;
	}

}